package com.lemon.smartsafety.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.lemon.smartsafety.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 项目名称：workspace
 * 类描述：
 * 创建人：Fargo
 * 创建时间：2016/8/22 14:55
 * 修改人：Fargo
 * 修改时间：2016/8/22 14:55
 * 修改备注：
 */
public class ViewRadarTitle extends LinearLayout {


    @Bind(R.id.txtTitle1)
    TextView txtTitle1;
    @Bind(R.id.txtTitleImg1)
    TextView txtTitleImg1;
    @Bind(R.id.txtTitle2)
    TextView txtTitle2;
    @Bind(R.id.txtTitleImg2)
    TextView txtTitleImg2;
    @Bind(R.id.txtTitle3)
    TextView txtTitle3;
    @Bind(R.id.txtTitleImg3)
    TextView txtTitleImg3;

    private View view;

    public ViewRadarTitle(Context context) {
        super(context);
        initView(context);
    }

    public ViewRadarTitle(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    public ViewRadarTitle(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
    }


    private void initView(Context context) {
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        view = inflater.inflate(R.layout.view_radar_title, this);
        ButterKnife.bind(this, view);

    }


    public void setTitle1(String string) {
        txtTitle1.setText(string);
        txtTitle1.setVisibility(VISIBLE);
    }

    public void setTitleImg1(int color) {
        txtTitleImg1.setBackgroundColor(color);
        txtTitleImg1.setVisibility(VISIBLE);
    }


    public void setTitle2(String string) {
        txtTitle2.setText(string);
        txtTitle2.setVisibility(VISIBLE);
    }

    public void setTitleImg2(int color) {
        txtTitleImg2.setBackgroundColor(color);
        txtTitleImg2.setVisibility(VISIBLE);
    }


    public void setTitle3(String string) {
        txtTitle3.setText(string);
        txtTitle3.setVisibility(VISIBLE);
    }

    public void setTitleImg3(int color) {
        txtTitleImg3.setBackgroundColor(color);
        txtTitleImg3.setVisibility(VISIBLE);
    }
}
